package com.zjitc.service.imp;

import com.zjitc.controller.AdminProduct;
import com.zjitc.dao.AdminProductDao;
import com.zjitc.dao.AdminUserDao;
import com.zjitc.dao.UserDao;
import com.zjitc.model.*;
import com.zjitc.service.AdminService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/6/4 13:33
 * @description:
 */
@Service
public class AdminServiceImp implements AdminService {
    @Autowired
    private AdminUserDao adminUserDao;
    private AdminProductDao adminProductDao;


  @Override
  public AdminUser findAdmin(String username) {
    return adminUserDao.findAdmin(username);
  }

  @Override
  public List<User> finduserList() {
    return adminProductDao.finduserList();
  }

  @Override
  public List<Category> findCatefory() {
    return adminProductDao.findCatefory();
  }

  @Override
  public List<CategorySecond> findCateforySecond() {
    return adminProductDao.findCateforySecond();
  }

  @Override
  public void addcategory(Integer cid, String cname) {
       adminProductDao.addcategory(cid,cname);
  }

  @Override
  public void addcategorySecond(Integer csid, String csname, Integer cid) {
      adminProductDao.addcategorySecond(csid,csname,cid);
  }

  @Override
  public void deleteCategory() {
    adminProductDao.deleteCategory();
  }

  @Override
  public void deletecategorySecond() {
    adminProductDao.deletecategorySecond();
  }

  @Override
  public void deleteById(String username) {
    adminUserDao.deleteById(username);
  }

  @Override
  public List<Product> findPid() {
    return adminProductDao.findPid();
  }

  @Override
  public void adminDeleteByPid(Integer pid) {
    adminProductDao.adminDeleteByPid(pid);
  }


}
